<?php
class User_model extends Model
{
	
	function __construct()
	{
		parent::factory();
	}
	
	function login($login, $pass)
	{
		
		$userName = parent::$db->escape($login);
		$passWord = parent::$db->escape($pass);
		
		$result = parent::$db->getRow("SELECT id, login, pass FROM t_admins WHERE login = '$userName' AND pass = '$passWord'");
		if (!is_null($result['login']) && !is_null($result['pass']))
			return 1;
		return 0;
	}

	function __destruct(){}
}
?>